﻿using System;
using UnityEngine;

namespace ParticlePlayground
{
	// Token: 0x0200016B RID: 363
	[Serializable]
	public class PlaygroundTransformC
	{
		// Token: 0x060008A4 RID: 2212 RVA: 0x00033CDC File Offset: 0x00031EDC
		public virtual bool Update()
		{
			if (this.transform != null)
			{
				this.instanceID = this.transform.GetInstanceID();
				this.previousPosition = this.position;
				this.position = this.transform.position;
				this.forward = this.transform.forward;
				this.up = this.transform.up;
				this.right = this.transform.right;
				this.rotation = this.transform.rotation;
				this.inverseRotation = this.rotation;
				this.inverseRotation.x = -this.inverseRotation.x;
				this.inverseRotation.y = -this.inverseRotation.y;
				this.inverseRotation.z = -this.inverseRotation.z;
				this.localScale = this.transform.localScale;
				this.lossyScale = this.transform.lossyScale;
				this.available = true;
			}
			else
			{
				this.available = false;
			}
			return this.available;
		}

		// Token: 0x060008A5 RID: 2213 RVA: 0x00033DF8 File Offset: 0x00031FF8
		public virtual void UpdateMatrix()
		{
			if (this.available)
			{
				this.transformMatrix.SetTRS(this.position, this.rotation, (this.scaleMethod != ScaleMethod.Local) ? this.lossyScale : this.localScale);
			}
		}

		// Token: 0x060008A6 RID: 2214 RVA: 0x00033E38 File Offset: 0x00032038
		public virtual bool IsSameAs(Transform comparer)
		{
			return this.transform == comparer;
		}

		// Token: 0x060008A7 RID: 2215 RVA: 0x00033E48 File Offset: 0x00032048
		public virtual void SetZeroRotation()
		{
			this.rotation = Quaternion.identity;
		}

		// Token: 0x060008A8 RID: 2216 RVA: 0x00033E58 File Offset: 0x00032058
		public virtual void SetFromTransform(Transform otherTransform)
		{
			this.transform = otherTransform;
			this.Update();
		}

		// Token: 0x060008A9 RID: 2217 RVA: 0x00033E68 File Offset: 0x00032068
		public virtual void GetFromTransform(Transform otherTransform)
		{
			otherTransform.position = this.position;
			otherTransform.rotation = this.rotation;
			otherTransform.localScale = this.localScale;
		}

		// Token: 0x060008AA RID: 2218 RVA: 0x00033E90 File Offset: 0x00032090
		public virtual void SetLocalPosition(Transform otherTransform)
		{
			if (this.available)
			{
				this.localPosition = otherTransform.InverseTransformPoint(this.transform.position);
			}
		}

		// Token: 0x060008AB RID: 2219 RVA: 0x00033EB4 File Offset: 0x000320B4
		public virtual void SetPostitionAsLocal()
		{
			this.position = this.localPosition;
		}

		// Token: 0x060008AC RID: 2220 RVA: 0x00033EC4 File Offset: 0x000320C4
		public virtual int GetInstanceID()
		{
			return this.instanceID;
		}

		// Token: 0x060008AD RID: 2221 RVA: 0x00033ECC File Offset: 0x000320CC
		public virtual PlaygroundTransformC Clone()
		{
			return new PlaygroundTransformC
			{
				transform = this.transform,
				available = this.available,
				position = this.position,
				forward = this.forward,
				up = this.up,
				right = this.right,
				rotation = this.rotation
			};
		}

		// Token: 0x040008C5 RID: 2245
		public Transform transform;

		// Token: 0x040008C6 RID: 2246
		public int instanceID;

		// Token: 0x040008C7 RID: 2247
		public bool available;

		// Token: 0x040008C8 RID: 2248
		public Vector3 position;

		// Token: 0x040008C9 RID: 2249
		public Vector3 localPosition;

		// Token: 0x040008CA RID: 2250
		public Vector3 previousPosition;

		// Token: 0x040008CB RID: 2251
		public Vector3 forward;

		// Token: 0x040008CC RID: 2252
		public Vector3 up;

		// Token: 0x040008CD RID: 2253
		public Vector3 right;

		// Token: 0x040008CE RID: 2254
		public Quaternion rotation;

		// Token: 0x040008CF RID: 2255
		public Quaternion inverseRotation;

		// Token: 0x040008D0 RID: 2256
		public ScaleMethod scaleMethod;

		// Token: 0x040008D1 RID: 2257
		public Vector3 localScale;

		// Token: 0x040008D2 RID: 2258
		public Vector3 lossyScale;

		// Token: 0x040008D3 RID: 2259
		public Matrix4x4 transformMatrix = default(Matrix4x4);

		// Token: 0x040008D4 RID: 2260
		public bool unfolded;
	}
}
